﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KL.Store.Core.Domain;
using TN.Data;
using TN.Web.Utils;

namespace KL.Store.Data
{
    public class dbMember
    {
        #region Get

        public static Member Get(int MemberId)
        {
            IList<Member> objectList = new List<Member>();
            SqlHelper.FillList(dbParameters.dsnStore, "SPR_ESTORE_UserInfo", objectList, new object[] { MemberId });

            return objectList.FirstOrDefault();
        }

        #endregion

        #region Insert

        public static void Insert(string Email, string Name, string Phone, int CreateUser)
        {
            SqlHelper.ExecuteScalar(dbParameters.dsnStore, "SPR_ESTORE_Member_Insert", new object[] { Email, Name, Phone, CreateUser });
        }

        #endregion

        #region Update

        public static void Update(int MemberId, string Email, string Name, string Phone, int UpdateUser)
        {
            SqlHelper.ExecuteNonQuery(dbParameters.dsnStore, "SPR_ESTORE_Member_Update", new object[] { MemberId, Email, Name, Phone, UpdateUser });
        }

        #endregion

    }
}
